package blog.service.impl;


import blog.dao.ChapterRecordDao;
import blog.pojo.ChapterRecord;
import blog.service.ChapterRecordService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class ChapterRecordServiceImpl implements ChapterRecordService {

    @Autowired
    private ChapterRecordDao chapterRecordDao;

    @Override
    public ChapterRecord getByChapterId(Integer id) throws Exception {
        return chapterRecordDao.selectOne(new QueryWrapper<>(new ChapterRecord().setChapterId(id)));
    }
}
